package kt.hkit.androidcomplete01.chapter07;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class CustomViewEx extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyView mv = new MyView(this);
		setContentView(mv);
	}
	
	class MyView extends View{
		Paint paint;
		
		public MyView(Context context) {
			super(context);
			paint = new Paint();
		}

		protected void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			canvas.drawColor(Color.LTGRAY);
			paint.setColor(Color.BLUE);
			canvas.drawCircle(100, 100, 80, paint);
			
			paint.setColor(Color.RED);
			canvas.drawCircle(300, 100, 80, paint);
		}
	
	}
}
